<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>绑定class和style | 我的笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-emphasize/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-prism/prism-solarizedlight.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
    

        
    
    
    <link rel="next" href="../VUE/2、绑定表单.html" />
    
    
    <link rel="prev" href="../VUE/vue.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="11.1"
        data-chapter-title="绑定class和style"
        data-filepath="VUE/1、绑定class和style.md"
        data-basepath=".."
        data-revision="Mon Oct 22 2018 12:05:33 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="gitbook的安装.html">
            
                
                    <a href="../gitbook的安装.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        gitbook的安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="HTML and CSS/1、css的引入方式.html">
            
                
                    <a href="../HTML and CSS/1、css的引入方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        HTML and CSS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="HTML and CSS/3、常用的标签.html">
            
                
                    <a href="../HTML and CSS/3、常用的标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        常用的标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="HTML and CSS/4、表格的使用.html">
            
                
                    <a href="../HTML and CSS/4、表格的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        表格的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="HTML and CSS/5、表单.html">
            
                
                    <a href="../HTML and CSS/5、表单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="HTML and CSS/6、a标签的使用.html">
            
                
                    <a href="../HTML and CSS/6、a标签的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        a标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="HTML and CSS/7、盒子模型.html">
            
                
                    <a href="../HTML and CSS/7、盒子模型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="HTML and CSS/8、浮动.html">
            
                
                    <a href="../HTML and CSS/8、浮动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="HTML and CSS/9、css常见问题.html">
            
                
                    <a href="../HTML and CSS/9、css常见问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        css常见问题
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="HTML and CSS/10、位置定位.html">
            
                
                    <a href="../HTML and CSS/10、位置定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        位置定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="HTML and CSS/11、阴影设置.html">
            
                
                    <a href="../HTML and CSS/11、阴影设置.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        阴影设置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="HTML and CSS/12、自定义动画.html">
            
                
                    <a href="../HTML and CSS/12、自定义动画.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="HTML and CSS/13、容器居中方法.html">
            
                
                    <a href="../HTML and CSS/13、容器居中方法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        容器居中
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="HTML and CSS/14、fullpage的使用.html">
            
                
                    <a href="../HTML and CSS/14、fullpage的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        fullpage的使用
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="移动端/移动端.html">
            
                
                    <a href="../移动端/移动端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        移动端
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="移动端/1、关于移动端.html">
            
                
                    <a href="../移动端/1、关于移动端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        关于移动端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="移动端/2、移动端小问题.html">
            
                
                    <a href="../移动端/2、移动端小问题.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        移动端小问题
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="flex布局/flex.html">
            
                
                    <a href="../flex布局/flex.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        flex弹性盒子
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="flex布局/1、flex布局.html">
            
                
                    <a href="../flex布局/1、flex布局.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        flex布局
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="响应式布局/bootstrap.html">
            
                
                    <a href="../响应式布局/bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        响应式布局
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="响应式布局/1、Bootstrap.html">
            
                
                    <a href="../响应式布局/1、Bootstrap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        Bootstrap
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="响应式布局/2、媒体查询.html">
            
                
                    <a href="../响应式布局/2、媒体查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="JavaScript/JavaScript.html">
            
                
                    <a href="../JavaScript/JavaScript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        JavaScript
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="JavaScript/1、JavaScript数据类型.html">
            
                
                    <a href="../JavaScript/1、JavaScript数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        JS数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="JavaScript/2、数据类型的转换.html">
            
                
                    <a href="../JavaScript/2、数据类型的转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        数据类型的转换
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="JavaScript/3、运算符.html">
            
                
                    <a href="../JavaScript/3、运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="JavaScript/4、赋值运算符.html">
            
                
                    <a href="../JavaScript/4、赋值运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        赋值运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="JavaScript/5、比较运算符.html">
            
                
                    <a href="../JavaScript/5、比较运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        比较运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="JavaScript/6、逻辑操作符.html">
            
                
                    <a href="../JavaScript/6、逻辑操作符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        逻辑操作符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="JavaScript/7、条件运算符.html">
            
                
                    <a href="../JavaScript/7、条件运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        条件运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="JavaScript/8、位运算符.html">
            
                
                    <a href="../JavaScript/8、位运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.8.</b>
                        
                        位运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.9" data-path="JavaScript/9、条件语句.html">
            
                
                    <a href="../JavaScript/9、条件语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.9.</b>
                        
                        条件语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.10" data-path="JavaScript/10、循环语句.html">
            
                
                    <a href="../JavaScript/10、循环语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.10.</b>
                        
                        循环语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.11" data-path="JavaScript/11、break和continue.html">
            
                
                    <a href="../JavaScript/11、break和continue.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.11.</b>
                        
                        break和continue
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.12" data-path="JavaScript/12、for循环.html">
            
                
                    <a href="../JavaScript/12、for循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.12.</b>
                        
                        for循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.13" data-path="JavaScript/13、多层循环.html">
            
                
                    <a href="../JavaScript/13、多层循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.13.</b>
                        
                        多层循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.14" data-path="JavaScript/14、for-in循环.html">
            
                
                    <a href="../JavaScript/14、for-in循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.14.</b>
                        
                        for-in循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.15" data-path="JavaScript/15、try-catch语句.html">
            
                
                    <a href="../JavaScript/15、try-catch语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.15.</b>
                        
                        try-catch语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.16" data-path="JavaScript/16、函数.html">
            
                
                    <a href="../JavaScript/16、函数.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.16.</b>
                        
                        函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.17" data-path="JavaScript/17、循环排序.html">
            
                
                    <a href="../JavaScript/17、循环排序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.17.</b>
                        
                        循环排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.18" data-path="JavaScript/18、es6语法.html">
            
                
                    <a href="../JavaScript/18、es6语法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.18.</b>
                        
                        es6语法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.19" data-path="JavaScript/19、数组对象.html">
            
                
                    <a href="../JavaScript/19、数组对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.19.</b>
                        
                        数组对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.20" data-path="JavaScript/20、date对象.html">
            
                
                    <a href="../JavaScript/20、date对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.20.</b>
                        
                        date对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.21" data-path="JavaScript/21、Boolean对象.html">
            
                
                    <a href="../JavaScript/21、Boolean对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.21.</b>
                        
                        Boolean对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.22" data-path="JavaScript/22、数学对象.html">
            
                
                    <a href="../JavaScript/22、数学对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.22.</b>
                        
                        数学对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.23" data-path="JavaScript/23、对象的创建.html">
            
                
                    <a href="../JavaScript/23、对象的创建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.23.</b>
                        
                        对象的创建
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="BOM/BOM.html">
            
                
                    <a href="../BOM/BOM.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        BOM
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="BOM/1、window对象.html">
            
                
                    <a href="../BOM/1、window对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        window对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="BOM/2、navigator对象.html">
            
                
                    <a href="../BOM/2、navigator对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        navigator对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="BOM/3、screen对象.html">
            
                
                    <a href="../BOM/3、screen对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        screen对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="BOM/4、history对象.html">
            
                
                    <a href="../BOM/4、history对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        history对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="BOM/5、location对象.html">
            
                
                    <a href="../BOM/5、location对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.</b>
                        
                        location对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="BOM/6、cookie对象.html">
            
                
                    <a href="../BOM/6、cookie对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.</b>
                        
                        cookie对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7" data-path="BOM/7、html5本地存储.html">
            
                
                    <a href="../BOM/7、html5本地存储.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.</b>
                        
                        html5本地存储
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="8" data-path="DOM/DOM.html">
            
                
                    <a href="../DOM/DOM.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        DOM
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="8.1" data-path="DOM/1、DOM介绍.html">
            
                
                    <a href="../DOM/1、DOM介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.1.</b>
                        
                        DOM介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="DOM/2、元素对象.html">
            
                
                    <a href="../DOM/2、元素对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.2.</b>
                        
                        元素对象
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="DOM/3、DOM事件1.html">
            
                
                    <a href="../DOM/3、DOM事件1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.3.</b>
                        
                        DOM事件1
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.4" data-path="DOM/4、DOM事件2.html">
            
                
                    <a href="../DOM/4、DOM事件2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.4.</b>
                        
                        DOM事件2
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8.5" data-path="DOM/5、移动端事件.html">
            
                
                    <a href="../DOM/5、移动端事件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.5.</b>
                        
                        移动端事件
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="9" data-path="Ajax/Ajax.html">
            
                
                    <a href="../Ajax/Ajax.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        Ajax
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="9.1" data-path="Ajax/Ajax的实现过程.html">
            
                
                    <a href="../Ajax/Ajax的实现过程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.1.</b>
                        
                        Ajax的实现过程
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="10" data-path="jQuery/jQuery.html">
            
                
                    <a href="../jQuery/jQuery.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.</b>
                        
                        jQuery
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="10.1" data-path="jQuery/1、选择器和效果.html">
            
                
                    <a href="../jQuery/1、选择器和效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.1.</b>
                        
                        选择器和效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.2" data-path="jQuery/2、jQuery属性.html">
            
                
                    <a href="../jQuery/2、jQuery属性.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.2.</b>
                        
                        jQuery属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.3" data-path="jQuery/3、正则表达式.html">
            
                
                    <a href="../jQuery/3、正则表达式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.3.</b>
                        
                        正则表达式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="10.4" data-path="jQuery/4、选择器和操作.html">
            
                
                    <a href="../jQuery/4、选择器和操作.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>10.4.</b>
                        
                        选择器和操作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="11" data-path="VUE/vue.html">
            
                
                    <a href="../VUE/vue.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.</b>
                        
                        VUE
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="11.1" data-path="VUE/1、绑定class和style.html">
            
                
                    <a href="../VUE/1、绑定class和style.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.1.</b>
                        
                        绑定class和style
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.2" data-path="VUE/2、绑定表单.html">
            
                
                    <a href="../VUE/2、绑定表单.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.2.</b>
                        
                        绑定表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.3" data-path="VUE/3、组件之间的数据传递.html">
            
                
                    <a href="../VUE/3、组件之间的数据传递.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.3.</b>
                        
                        组件之间的数据传递
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.4" data-path="VUE/4、vue-router.html">
            
                
                    <a href="../VUE/4、vue-router.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.4.</b>
                        
                        vue-router
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.5" data-path="VUE/style样式.html">
            
                
                    <a href="../VUE/style样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.5.</b>
                        
                        style样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.6" data-path="VUE/生命周期函数.html">
            
                
                    <a href="../VUE/生命周期函数.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.6.</b>
                        
                        生命周期函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.7" data-path="VUE/vue-resource.html">
            
                
                    <a href="../VUE/vue-resource.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.7.</b>
                        
                        vue-resource
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.8" data-path="VUE/axios.html">
            
                
                    <a href="../VUE/axios.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.8.</b>
                        
                        axios
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.9" data-path="VUE/vue动画.html">
            
                
                    <a href="../VUE/vue动画.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.9.</b>
                        
                        vue动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.10" data-path="VUE/插槽的使用.html">
            
                
                    <a href="../VUE/插槽的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.10.</b>
                        
                        插槽的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="11.11" data-path="VUE/ajax与框架搭建.html">
            
                
                    <a href="../VUE/ajax与框架搭建.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>11.11.</b>
                        
                        ajax与框架搭建
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="12" data-path="ES6/ES6.html">
            
                
                    <a href="../ES6/ES6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.</b>
                        
                        ES6
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="12.1" data-path="ES6/1、promise.html">
            
                
                    <a href="../ES6/1、promise.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.1.</b>
                        
                        promise
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="12.2" data-path="ES6/2、数组的扩展.html">
            
                
                    <a href="../ES6/2、数组的扩展.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.2.</b>
                        
                        数组的扩展
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="12.3" data-path="ES6/3、set的使用.html">
            
                
                    <a href="../ES6/3、set的使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.3.</b>
                        
                        set的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="12.4" data-path="ES6/4、类和类的继承.html">
            
                
                    <a href="../ES6/4、类和类的继承.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>12.4.</b>
                        
                        类和类的继承
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="13" data-path="JS、JQ阻止事件冒泡.html">
            
                
                    <a href="../JS、JQ阻止事件冒泡.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>13.</b>
                        
                        JS、JQ阻止事件冒泡
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="14" data-path="微信小程序/微信小程序.html">
            
                
                    <a href="../微信小程序/微信小程序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>14.</b>
                        
                        微信小程序
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >我的笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="vue">vue</h1>
<ul>
<li><p>&#x6570;&#x636E;&#x9A71;&#x52A8;&#x89C6;&#x56FE;(&#x5C3D;&#x91CF;&#x51CF;&#x5C11;DOM&#x7684;&#x64CD;&#x4F5C;)</p>
</li>
<li><p>&#x600E;&#x4E48;&#x7528;&#xFF1A;</p>
<ul>
<li>&#x901A;&#x8FC7;new&#x5173;&#x952E;&#x8BCD;&#x5B9E;&#x4F8B;&#x5316;&#x4E00;&#x4E2A;vue&#x5BF9;&#x8C61;</li>
<li>el:&#x4EE3;&#x8868;&#x6211;&#x4EEC;vue&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;&#x63A7;&#x5236;&#x7684;DOM&#x5BF9;&#x8C61;&#x8303;&#x56F4;<ul>
<li>&#x503C;&#x4E3A;css&#x9009;&#x62E9;&#x5668;&#x6216;&#x8005;DOM&#x5BF9;&#x8C61;</li>
</ul>
</li>
<li>data:&#x7528;&#x6765;&#x50A8;&#x5B58;&#x6570;&#x636E;<ul>
<li>&#x600E;&#x4E48;&#x628A;&#x6570;&#x636E;&#x6E32;&#x67D3;&#x5230;&#x9875;&#x9762;&#xFF1F;<ul>
<li>&#x901A;&#x8FC7;&#x4E24;&#x4E2A;&#x4E2D;&#x62EC;&#x53F7;&#x7B26;&#x53F7;&#x6765;&#x63D2;&#x5165;&#x5230;&#x9875;&#x9762;(&#x53EB;&#x505A;&#x63D2;&#x503C;&#x8868;&#x8FBE;&#x5F0F;)&#xFF0C;&#x4E0D;&#x8BC6;&#x522B;&#x6807;&#x7B7E;</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li><p>&#x6307;&#x4EE4;:v-html&#xFF0C;&#x53EF;&#x4EE5;&#x5C06;&#x5185;&#x5BB9;&#x4E2D;&#x7684;&#x6807;&#x7B7E;&#x8BC6;&#x522B;&#x51FA;&#x6765;&#x3002;</p>
<ul>
<li>v-bind:propertyName  &#x7528;&#x4E8E;&#x7ED1;&#x5B9A;&#x5143;&#x7D20;&#x5C5E;&#x6027;<ul>
<li>&#x6BD4;&#x5982;: v-bind:title =&gt; :title</li>
</ul>
</li>
<li>v-on:&#x7528;&#x6765;&#x6CE8;&#x518C;&#x4E8B;&#x4EF6;&#x76D1;&#x542C;&#xFF0C;&#x53EF;&#x7B80;&#x5199;&#x4E3A;@<ul>
<li>&#x6BD4;&#x5982;: v-on:click =&gt; @click</li>
</ul>
</li>
<li>v-if:&#x7528;&#x4E8E;&#x5224;&#x65AD;&#x4E00;&#x4E2A;&#x7ED3;&#x6784;&#x662F;&#x5426;&#x88AB;&#x6E32;&#x67D3;&#x5230;&#x9875;&#x9762;&#xFF0C;&#x662F;&#x76F4;&#x63A5;&#x79FB;&#x9664;&#x6216;&#x63D2;&#x5165;&#x5185;&#x5BB9;&#x6765;&#x8FBE;&#x5230;&#x9690;&#x85CF;&#x663E;&#x793A;&#x7684;&#x6548;&#x679C;&#xFF0C;&#x5224;&#x65AD;&#x7684;&#x6761;&#x4EF6;&#x4E3A;true&#x5219;&#x6E32;&#x67D3;&#xFF0C;false&#x5219;&#x4E0D;&#x6E32;&#x67D3;</li>
<li>v-show:&#x5224;&#x65AD;&#x4E00;&#x4E2A;&#x7ED3;&#x6784;&#x662F;&#x5426;&#x663E;&#x793A;&#x5728;&#x9875;&#x9762;&#xFF0C;&#x662F;&#x901A;&#x8FC7;&#x63A7;&#x5236;css&#x7684;display&#x5C5E;&#x6027;&#x6765;&#x63A7;&#x5236;&#x5185;&#x5BB9;&#x7684;&#x663E;&#x793A;&#x9690;&#x85CF;</li>
<li>v-for:&#x5FAA;&#x73AF;&#x6570;&#x7EC4;&#x6216;&#x5BF9;&#x8C61;<ul>
<li>&#x6BD4;&#x5982;&#xFF1A;v-for=&quot;item in list&quot;</li>
<li>&#x8868;&#x793A;&#x5FAA;&#x73AF;list&#x6570;&#x7EC4;&#xFF0C;&#x5E76;&#x5C06;&#x6570;&#x7EC4;&#x91CC;&#x9762;&#x7684;&#x6BCF;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x8D4B;&#x503C;&#x7ED9;item</li>
<li>v-for=&quot;(item,index) in list&quot;</li>
<li>&#x5C0F;&#x62EC;&#x53F7;&#x91CC;&#x9762;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x503C;&#x4EE3;&#x8868;&#x6570;&#x7EC4;&#x91CC;&#x9762;&#x7684;&#x5143;&#x7D20;&#xFF0C;&#x7B2C;&#x4E8C;&#x4E2A;&#x503C;&#x4EE3;&#x8868;&#x6570;&#x7EC4;&#x5143;&#x7D20;&#x7684;&#x4E0B;&#x6807;&#x503C;</li>
</ul>
</li>
</ul>
</li>
<li><p>&#x4FEE;&#x9970;&#x7B26;&#xFF1A;</p>
<ul>
<li>.stop:&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;</li>
<li>.prevent:&#x963B;&#x6B62;&#x9ED8;&#x8BA4;&#x4E8B;&#x4EF6;</li>
<li>.capture:&#x66F4;&#x6539;&#x4E8B;&#x4EF6;&#x4F20;&#x9012;&#x8FC7;&#x7A0B;&#x4E3A;&#x4E8B;&#x4EF6;&#x6355;&#x83B7;</li>
<li>.self:&#x963B;&#x6B62;&#x81EA;&#x8EAB;&#x7684;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;</li>
<li>.once:&#x4E00;&#x6B21;&#x4E8B;&#x4EF6;</li>
<li>.passive &#x4FEE;&#x9970;&#x7B26;&#x5C24;&#x5176;&#x80FD;&#x591F;&#x63D0;&#x5347;&#x79FB;&#x52A8;&#x7AEF;&#x7684;&#x6027;&#x80FD;</li>
</ul>
</li>
<li><p>&#x6309;&#x952E;&#x4FEE;&#x9970;&#x7B26;</p>
<ul>
<li>.enter</li>
<li>.tab</li>
<li>.esc</li>
<li>.delete</li>
<li>.space</li>
<li>.up</li>
<li>.down</li>
<li>.left</li>
<li>.right</li>
<li>.exact:&#x7CBE;&#x786E;&#x89E6;&#x53D1;&#x6307;&#x5B9A;&#x7684;&#x4E00;&#x4E2A;&#x4E8B;&#x4EF6;</li>
</ul>
</li>
<li><p>&#x5728;vue&#x4E2D;this&#x7684;&#x56DE;&#x54CD;&#x59CB;&#x7EC8;&#x6307;&#x5411;vue&#x5B9E;&#x4F8B;&#x5BF9;&#x8C61;&#xFF0C;&#x9664;&#x975E;&#x624B;&#x52A8;&#x66F4;&#x6539;</p>
</li>
<li><p>vue&#x4E2D;&#x540C;&#x6837;&#x6709;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;</p>
<ul>
<li>1&#x3001;&#x5982;&#x679C;&#x8C03;&#x7528;&#x51FD;&#x6570;&#x6CA1;&#x6709;&#x4F20;&#x53C2;&#xFF0C;&#x5219;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;</li>
<li>2&#x3001;&#x5982;&#x679C;&#x8C03;&#x7528;&#x51FD;&#x6570;&#x6709;&#x4F20;&#x53C2;&#xFF0C;&#x90A3;&#x4E48;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;&#x9700;&#x8981;&#x901A;&#x8FC7;$event&#x6765;&#x4F20;&#x5165;&#x3002;</li>
</ul>
</li>
<li><p>&#x539F;&#x751F;&#x66F4;&#x6539;&#x4E8B;&#x4EF6;&#x4F20;&#x9012;&#x8FC7;&#x7A0B;&#x4E3A;&#x4E8B;&#x4EF6;&#x6355;&#x83B7;</p>
<ul>
<li>addEventListener(eventType,callback,bool)</li>
<li>bool:&#x7528;&#x4E8E;&#x8BBE;&#x7F6E;&#x4E8B;&#x4EF6;&#x4F20;&#x9012;&#x8FC7;&#x7A0B;&#xFF0C;&#x503C;&#x4E3A;true&#xFF0C;&#x5219;&#x4E8B;&#x4EF6;&#x6355;&#x83B7;</li>
<li>false:&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;</li>
</ul>
</li>
</ul>
<pre><code>        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>text/css<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token style language-css">
            <span class="token selector">html,body,.app</span><span class="token punctuation">{</span>
                <span class="token property">height</span><span class="token punctuation">:</span> 100%<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token selector">.app</span><span class="token punctuation">{</span>
                <span class="token property">overflow-y</span><span class="token punctuation">:</span> scroll<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token selector">.sc</span><span class="token punctuation">{</span>
                <span class="token property">height</span><span class="token punctuation">:</span> 1000px<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        </span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>
</code></pre><pre><code>            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>app<span class="token punctuation">&quot;</span></span> <span class="token attr-name">@scroll.passive</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>scroll<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
            { {content+titl} }
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>test<span class="token punctuation">&quot;</span></span> <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>test<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
                &#x6211;&#x662F;&#x7528;&#x6765;&#x6D4B;&#x8BD5;vue&#x4FEE;&#x9970;&#x7B26;&#x7684;
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span> <span class="token attr-name">v-html</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>content<span class="token punctuation">&quot;</span></span> <span class="token attr-name">@click.once</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>changCont(<span class="token punctuation">&apos;</span>123<span class="token punctuation">&apos;</span>,$event)<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>img</span> <span class="token attr-name"><span class="token namespace">v-bind:</span>src</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>src<span class="token punctuation">&quot;</span></span> <span class="token attr-name"><span class="token namespace">v-bind:</span>title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>titl<span class="token punctuation">&quot;</span></span><span class="token punctuation">/&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span> <span class="token attr-name">v-if</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>isShow<span class="token punctuation">&quot;</span></span> <span class="token punctuation">&gt;</span></span>&#x6211;&#x662F;h1&#x6807;&#x7B7E;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span> <span class="token attr-name">v-show</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>isShow<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>&#x6211;&#x662F;h2&#x6807;&#x7B7E;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span> <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>(item,index) in objList<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>{ {index} }---{ {item} }<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>input</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>text<span class="token punctuation">&quot;</span></span> <span class="token attr-name">@keydown.enter.exact</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>ent<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>sc<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
</code></pre><pre><code>            var vm = new Vue({
                el:&quot;.app&quot;,
                data:{
                    content:&quot;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>b</span><span class="token punctuation">&gt;</span></span>hello world!<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>b</span><span class="token punctuation">&gt;</span></span>&quot;,
                    src:&quot;img/timg.jpg&quot;,
                    titl:&quot;&#x6211;&#x662F;&#x4E00;&#x4E2A;&#x53EF;&#x7231;&#x7684;&#x4EBA;&quot;,
                    isShow:false,
                    list:[
                        &quot;123456&quot;,
                        &quot;456789&quot;
                    ],
                    objList:{
                        &quot;name&quot;:&quot;&#x5C0F;&#x660E;&quot;,
                        &quot;sex&quot;:&quot;&#x7537;&quot;,
                        &quot;age&quot;:&quot;18&quot;
                    }
                },
                methods:{
                    changCont:function(index,e){
                        this.content = &quot;goodbye world!&quot;,
                        this.isShow = true;
                        console.log(this);
                        console.log(e);
                        alert(&quot;&#x6211;&#x662F;&#x5B50;&#x7EA7;&#x5143;&#x7D20;&#x91CC;&#x9762;&#x7684;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&quot;)
                    },
                    test:function(){
                        alert(&quot;&#x6211;&#x662F;&#x7236;&#x7EA7;&#x5143;&#x7D20;&#x7684;&#x70B9;&#x51FB;&#x4E8B;&#x4EF6;&quot;)
                    },
                    scroll:function(){
                        console.log(123);
                    },
                    ent:function(){
                        console.log(&quot;&#x6211;&#x6309;&#x4E0B;&#x4E86;enter&#x952E;&quot;)
                    }
                }
            })
</code></pre><h1 id="&#x7ED1;&#x5B9A;class&#x548C;style">&#x7ED1;&#x5B9A;class&#x548C;style</h1>
<ul>
<li>&#x6DFB;&#x52A0;&#x7C7B;&#x540D;</li>
<li><p>1&#x3001;&#x5BF9;&#x8C61;&#x8BED;&#x6CD5;</p>
<ul>
<li>&#x901A;&#x8FC7;v-bind&#x7ED1;&#x5B9A;&#x7C7B;&#x540D;</li>
<li>&#x4F8B;&#x5982;: :class=&quot;{cName1,cName2...}&quot;</li>
<li>cName1:&#x8868;&#x793A;&#x7C7B;&#x540D;&#xFF0C;&#x9700;&#x8981;&#x5728;vue&#x5B9E;&#x4F8B;&#x7684;data&#x4E2D;&#x58F0;&#x660E;</li>
</ul>
</li>
<li><p>2&#x3001;&#x6570;&#x7EC4;&#x8BED;&#x6CD5;</p>
<ul>
<li>&#x4F8B;&#x5982;&#xFF1A; :class=&quot;[cName1,cName2...]&quot;</li>
<li>&#x6570;&#x7EC4;&#x91CC;&#x9762;&#x53EF;&#x4EE5;&#x5E94;&#x7528;&#x8868;&#x8FBE;&#x5F0F;</li>
</ul>
</li>
<li><p>&#x6DFB;&#x52A0;&#x6837;&#x5F0F;</p>
</li>
<li><p>1&#x3001;&#x5BF9;&#x8C61;&#x8BED;&#x6CD5;</p>
<ul>
<li>&#x4F8B;&#x5982;&#xFF1A; :style=&quot;{pName:pValue,pName1:pValue1}&quot;</li>
<li>pName:&#x5C5E;&#x6027;&#x540D;&#x3002;pValue:&#x5C5E;&#x6027;&#x503C;</li>
<li>:style=&quot;obj&quot;</li>
<li>obj:&#x662F;&#x4E00;&#x4E2A;&#x7531;css&#x5C5E;&#x6027;&#x6784;&#x6210;&#x7684;&#x5BF9;&#x8C61;</li>
</ul>
</li>
<li><p>2&#x3001;&#x6570;&#x7EC4;&#x8BED;&#x6CD5;</p>
<ul>
<li>&#x4F8B;&#x5982;: :style=&quot;[styleObj1,styleObj2]&quot;</li>
<li>styleObj1,styleObj2:&#x662F;&#x4E00;&#x4E2A;&#x7531;css&#x5C5E;&#x6027;&#x6784;&#x6210;&#x7684;&#x5BF9;&#x8C61;</li>
</ul>
</li>
</ul>
<pre><code>style&#x6837;&#x5F0F;&#xFF1A;
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>text/css<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token style language-css">
            <span class="token selector">.test</span><span class="token punctuation">{</span>
                <span class="token property">width</span><span class="token punctuation">:</span> 200px<span class="token punctuation">;</span>
                <span class="token property">height</span><span class="token punctuation">:</span> 200px<span class="token punctuation">;</span>
                <span class="token property">background-color</span><span class="token punctuation">:</span> skyblue<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
            <span class="token selector">.test1</span><span class="token punctuation">{</span>
                <span class="token property">width</span><span class="token punctuation">:</span> 200px<span class="token punctuation">;</span>
                <span class="token property">height</span><span class="token punctuation">:</span> 200px<span class="token punctuation">;</span>
                <span class="token property">background-color</span><span class="token punctuation">:</span> pink<span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        </span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>
</code></pre><pre><code>html&#x6837;&#x5F0F;&#xFF1A;
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>app<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span> <span class="token attr-name">:</span><span class="token style-attr language-css"><span class="token attr-name"><span class="token attr-name">style</span></span><span class="token punctuation">=&quot;</span><span class="token attr-value"><span class="token punctuation">{</span><span class="token property">fontSize</span><span class="token punctuation">:</span>fontSize+<span class="token string">&apos;px&apos;</span>,<span class="token property">color</span><span class="token punctuation">:</span>aColor<span class="token punctuation">}</span></span><span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>&#x6211;&#x662F;&#x4E00;&#x4E2A;P&#x6807;&#x7B7E;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h1</span> <span class="token attr-name">:</span><span class="token style-attr language-css"><span class="token attr-name"><span class="token attr-name">style</span></span><span class="token punctuation">=&quot;</span><span class="token attr-value">styleObj</span><span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>&#x6211;&#x662F;h1&#x6807;&#x7B7E;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h1</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>h2</span> <span class="token attr-name">:</span><span class="token style-attr language-css"><span class="token attr-name"><span class="token attr-name">style</span></span><span class="token punctuation">=&quot;</span><span class="token attr-value">[styleObj,bColor]</span><span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>123456<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>h2</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">:class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>{test:isClick,test1}<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">:class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>classObj<span class="token punctuation">&quot;</span></span> <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>changOrder<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">:class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>classObj<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>changeClass<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>&#x70B9;&#x6211;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">:class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>[isShow?<span class="token punctuation">&apos;</span>test<span class="token punctuation">&apos;</span>:<span class="token punctuation">&apos;</span><span class="token punctuation">&apos;</span>,two]<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
</code></pre><pre><code>javascript&#x6837;&#x5F0F;&#xFF1A;
            var vm = new Vue({
                el:&quot;.app&quot;,
                data:{
                    isClick:true,
                    isShow:false,
//                    classObj:false,
                    message:&quot;hello&quot;,
                    test1:&quot;test1&quot;,
                    one:&quot;test&quot;,
                    two:&quot;two&quot;,
                    fontSize:50,
                    aColor:&quot;red&quot;,
                    styleObj:{
                        fontSize:30+&quot;px&quot;,
                        color:&quot;skyblue&quot;,
                        transform:&quot;scale(1.2)&quot;
                    },
                    bColor:{color:&quot;red&quot;}
                },
                methods:{
                    changeClass:function(){
                        this.isClick = !this.isClick;
                        this.isShow = !this.isShow;
                    },
                    changOrder:function(){
                        this.message = this.changeOrder
                    }
                },
                computed:{
                    changeOrder:function(){
                        return this.message.split(&quot;&quot;).reverse().join(&quot;&quot;);
                    },
                    classObj:function(){
                        return &quot;test&quot;
                    }
                }
            })
            console.log(vm.changeOrder);
</code></pre><h1 id="&#x6761;&#x4EF6;&#x6E32;&#x67D3;">&#x6761;&#x4EF6;&#x6E32;&#x67D3;</h1>
<ul>
<li><p>&#x6307;&#x4EE4;&#xFF1A;</p>
<ul>
<li>v-else: &#x8981;&#x914D;&#x5408;v-if&#x4F7F;&#x7528;</li>
<li>v-else-if:&#x76F8;&#x5F53;&#x4E8E;&#x539F;&#x751F;js&#x7684;else-if</li>
</ul>
</li>
<li><p>&#x5217;&#x8868;&#x6E32;&#x67D3;</p>
<ul>
<li>:key &#x7684;&#x4F5C;&#x7528;<ul>
<li>1&#x3001;&#x9AD8;&#x6548;&#x7684;&#x6E32;&#x67D3;&#x865A;&#x62DF;DOM</li>
<li>2&#x3001;&#x53E6;&#x5916;vue&#x4E2D;&#x5728;&#x4F7F;&#x7528;&#x76F8;&#x540C;&#x6807;&#x7B7E;&#x540D;u&#x5B89;&#x901F;&#x8FBE;&#x8FC7;&#x6E21;&#x5207;&#x6362;&#x65F6;&#xFF0C;&#x4E5F;&#x4F1A;&#x4F7F;&#x7528;&#x5230;key&#x5C5E;&#x6027;&#xFF0C;&#x5176;&#x76EE;&#x7684;&#x4E5F;&#x662F;&#x4E3A;&#x4E86;&#x8BA9;vue&#x53EF;&#x4EE5;&#x533A;&#x5206;&#x5B83;&#x4EEC;&#x3002;</li>
</ul>
</li>
</ul>
</li>
</ul>
<pre><code>html&#x6837;&#x5F0F;&#xFF1A;
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>app<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
            <span class="token comment" spellcheck="true">&lt;!--&#x4E0B;&#x9762;&#x4F8B;&#x5B50;&#x8868;&#x793A;&#xFF1A;&#x5982;&#x679C;isShow&#x4E3A;true&#xFF0C;&#x5219;&#x663E;&#x793A;&#x63D0;&#x4EA4;&#x6309;&#x94AE;--&gt;</span>
            <span class="token comment" spellcheck="true">&lt;!--&#x5426;&#x5219;&#x663E;&#x793A;&#x786E;&#x5B9A;&#x6309;&#x94AE;--&gt;</span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">v-if</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>isShow<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>&#x63D0;&#x4EA4;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>button</span> <span class="token attr-name">v-else</span> <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>conf<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>&#x786E;&#x5B9A;<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>button</span><span class="token punctuation">&gt;</span></span>

            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span> <span class="token attr-name">v-if</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>type<span class="token punctuation">=</span><span class="token punctuation">=</span><span class="token punctuation">&apos;</span>A<span class="token punctuation">&apos;</span><span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>A<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span> <span class="token attr-name">v-else-if</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>type<span class="token punctuation">=</span><span class="token punctuation">=</span><span class="token punctuation">&apos;</span>B<span class="token punctuation">&apos;</span><span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>B<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span> <span class="token attr-name">v-else</span><span class="token punctuation">&gt;</span></span>type:<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>

            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span> <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>(item,index) in list<span class="token punctuation">&quot;</span></span> <span class="token attr-name">:key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>item<span class="token punctuation">&quot;</span></span> <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>changCont<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">&gt;</span></span>

            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ul</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>li</span> <span class="token attr-name">v-for</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>(item,index) in newList<span class="token punctuation">&quot;</span></span> <span class="token attr-name">:key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>item.id<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>li</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ul</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
</code></pre><pre><code>javascript&#x6837;&#x5F0F;&#xFF1A;
            var vm = new Vue({
                el:&quot;.app&quot;,
                data:{
                    isShow:false,
                    type:&quot;1234&quot;,
                    list:[
                        &quot;html&#x662F;&#x8D85;&#x6587;&#x672C;&#x6807;&#x8BB0;&#x8BED;&#x8A00;&quot;,
                        &quot;css&#x662F;&#x5C42;&#x53E0;&#x6837;&#x5F0F;&#x8868;&quot;
                    ],
                    newList:[
                        {&quot;id&quot;:1,&quot;name&quot;:&quot;bgg&quot;},
                        {&quot;id&quot;:2,&quot;name&quot;:&quot;css&quot;}

                    ]
                },
                methods:{
                    conf:function(){
                        this.isShow = true;
                    },
                    changCont:function(){
                        /**
                         * &#x5F53;&#x6211;&#x4EEC;&#x901A;&#x8FC7;&#x6570;&#x7EC4;&#x4E0B;&#x6807;&#x503C;&#x6765;&#x6539;&#x53D8;&#x6570;&#x7EC4;&#x8BF6;&#x8363;&#x7684;&#x8BDD;&#xFF0C;&#x662F;&#x4E0D;&#x4F1A;&#x89E6;&#x53D1;
                         * &#x89C6;&#x56FE;&#x66F4;&#x65B0;&#x7684;&#x3002;
                         * &#x4F1A;&#x89E6;&#x53D1;&#x89C6;&#x56FE;&#x66F4;&#x65B0;&#x7684;&#x6709;&#x4EE5;&#x4E0B;&#x51E0;&#x79CD;&#x65B9;&#x6CD5;&#xFF1A;
                         *     1&#x3001;splice()//&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x66FF;&#x6362;/&#x5220;&#x9664;/&#x6DFB;&#x52A0;&#x6570;&#x7EC4;&#x5185;&#x67D0;&#x4E00;&#x4E2A;&#x6216;&#x8005;&#x51E0;&#x4E2A;&#x503C;&#xFF08;&#x8BE5;&#x65B9;&#x6CD5;&#x4F1A;&#x6539;&#x53D8;&#x539F;&#x59CB;&#x6570;&#x7EC4;&#xFF09;
                         *     2&#x3001;push()//&#x540E;&#x9762;&#x52A0;
                         *     3&#x3001;pop()//&#x540E;&#x9762;&#x51CF;
                         *     4&#x3001;shift()//&#x524D;&#x9762;&#x51CF;
                         *     5&#x3001;unshift()//&#x524D;&#x9762;&#x52A0;
                         *     6&#x3001;sort()//&#x6392;&#x5E8F;
                         *     7&#x3001;reverse()//&#x5012;&#x5E8F;
                         * */
                        //this.list[0] = &quot;javascript&quot;
                        this.list.splice(0,1,&quot;javascript&quot;)//1&#x4E3A;&#x66FF;&#x6362;&#x7684;&#x6570;&#x7EC4;&#x957F;&#x5EA6;
                    }
                }
            })
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../VUE/vue.html" class="navigation navigation-prev " aria-label="Previous page: VUE"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../VUE/2、绑定表单.html" class="navigation navigation-next " aria-label="Next page: 绑定表单"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"prism":{"css":["prismjs/themes/prism-solarizedlight.css"]},"emphasize":{},"expandable-chapters":{},"fontsettings":{"theme":"white","family":"sans","size":2},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
